/**
 События ДТП
 */
function DtpEvent() {
    var _idDtp, comment;
    this.type = function (el) {
        $("#tr_type_event td").css("background-color", "transparent");
        $("#tr_type_event td").css("background", "none");
        //el.style.backgroundColor='red';
        el.style.backgroundColor = '#A2E8F2';
        el.style.backgroundImage = 'url(../images/check.png) no-repeat top right';
        el.style.background = 'url(../images/check.png) no-repeat top right 1px #A2E8F2';

    };

    this.markOnTheMap = function(param){

    }

    this.eventClick = function(param){
        //var text = document.getElementById('comment'+param).innerHTML
       // reMarkText
        vhide({id:'cancel_reMark'});
        _idDtp = param;

        document.getElementById('reMarkText').value = document.getElementById('comment'+param).innerHTML;
        indexMarkMap = 1;

       //alert(text);
       // alert(param+' '+setDtpLatLng+' Функция в разработке');
    };

    this.reMarkEvent = function(){
        indexMarkMap = 0;
        comment = document.getElementById('reMarkText').value;
        var temp, tempArr=[], lat, lng;
        if(setDtpLatLng){
            temp=setDtpLatLng.toString();
            temp=temp.replace( 'LatLng(', '' );
            temp=temp.replace(')','');
            tempArr=temp.split(',');
            lat=tempArr[0];
            lng=tempArr[1];
        }else{
            lat = 0;
            lng = 0;
        }

       var remark = $.ajax({
            type:'POST',
            url:'remarkEvent.php',
            data: 'login='+login+  '&pass='+pass+ '&id='+_idDtp+'&lat='+lat+'&lng='+lng+'&comment='+comment,
            async: false,
            success: function (data){
                zaprosDtp();
                if(tempMarker){
                    map.removeLayer(tempMarker);
                    tempMarker = null;
                }
                //alert(data);
                //proverka_popoln();
            }

        }).responseText;
     //   alert(remark);
    };



}
var dtpEvent = new DtpEvent();